package decisionalalgorithms.guialgorithms.servicesImpl;

import decisionalalgorithms.guialgorithms.domain.MatrixBuildDetails;
import decisionalalgorithms.guialgorithms.repositories.MatrixRepository;
import decisionalalgorithms.guialgorithms.repositories.MatrixService;
import org.springframework.stereotype.Service;

import java.util.HashSet;
import java.util.Set;
@Service
public class MatrixServiceImpl implements MatrixService {

    private final MatrixRepository matrixRepository;

    public MatrixServiceImpl(MatrixRepository matrixRepository) {
        this.matrixRepository = matrixRepository;
    }

    @Override
    public Set<MatrixBuildDetails> getMatrixDetails() {
        Set<MatrixBuildDetails> matrixBuildDetailsSet = new HashSet<>();

        matrixRepository.findAll().forEach(matrixBuildDetailsSet::add);
        return matrixBuildDetailsSet;
    }
}
